import csv
import json

my_dict = {}

with open('employees.csv', newline='', encoding='UTF-8') as file_obj:
    reader_object = csv.DictReader(file_obj)
    for row in reader_object:
        key = row['id']
        my_dict[key] = row

with open('employee.json', 'w', encoding='utf-8') as file_obj:
    json.dump(my_dict, file_obj, indent=4)